/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef SPATIAL_AWARENESS_MGR_ERRORS_H
#define SPATIAL_AWARENESS_MGR_ERRORS_H

#include <errors.h>

namespace OHOS {
namespace Msdp {
enum {
    /**
     *  Module type: SpatialAwareness Manager Service
     */
    SPATIAL_AWARENESS_MODULE_TYPE_SERVICE = 0,
    /**
     *  Module type: SpatialAwareness Manager Kit
     */
    SPATIAL_AWARENESS_MODULE_TYPE_KIT = 1
};

// offset of SpatialAwarenessmgr error, only be used in this file.
constexpr ErrCode SPATIAL_AWARENESSFWK_SERVICE_ERR_OFFSET =
    ErrCodeOffset(SUBSYS_MSDP, SPATIAL_AWARENESS_MODULE_TYPE_SERVICE);

enum {
    E_WRITE_PARCEL_ERROR = SPATIAL_AWARENESSFWK_SERVICE_ERR_OFFSET,
    E_READ_PARCEL_ERROR,
    E_GET_SYSTEM_ABILITY_MANAGER_FAILED,
    E_GET_SPATIAL_AWARENESS_SERVICE_FAILED,
    E_ADD_DEATH_RECIPIENT_FAILED,
    E_INNER_ERR
};

enum {
    SPATIALMANAGER_FAILED = (-10000),
    SPATIALMANAGER_SERVICE_NOT_READY,
    SPATIALMANAGER_DEVICE_ALREADY_TRUSTED,
    SPATIALMANAGER_GET_TRUSTED_DEVICE_FAILED,
    SPATIALMANAGER_ALREADY_INIT,
    SPATIALMANAGER_INIT_FAILED,
    SPATIALMANAGER_MALLOC_ERROR,
    SPATIALMANAGER_LOCK_ERROR,
    SPATIALMANAGER_INVALID_PARAM,
    SPATIALMANAGER_INVALID_VALUE,
    SPATIALMANAGER_COPY_FAILED,
    SPATIALMANAGER_NULLPTR,
    SPATIALMANAGER_DISCOVERY_FAILED,
    SPATIALMANAGER_FLATTEN_OBJECT,
    SPATIALMANAGER_WRITE_FAILED,
    SPATIALMANAGER_IPC_FAILED,
    SPATIALMANAGER_IPC_TRANSACTION_FAILED,
    SPATIALMANAGER_IPC_NOT_REGISTER_FUNC,
    HICHAIN_GROUP_CREATE_FAILED,
    HICHAIN_MEMBER_ADD_FAILED,
    HICHAIN_CREATE_CHANNEL_FAILED,
    MSG_DECODE_PARA_FAILED,
    ENCRYPT_UTILS_INVALID_PARAM,
    ENCRYPT_UTILS_GCM_SETKEY_FAILED,
    ENCRYPT_UTILS_GCM_CRYPT_FAILED,
    ENCRYPT_UTILS_GCM_AUTH_DECRYPT_FAILED,
    ENCRYPT_UTILS_AES_GCM_ENCRYPT_FAILED,
    ENCRYPT_UTILS_AES_GCM_DECRYPT_FAILED,
    ERR_GEN_RANDOM_PINTOKEN_FAILED,
    PIN_CODE_CHECK_FAILED,
    PIN_TOKEN_CHECK_FAILED,
    SPATIALMANAGER_CREATE_SESSION_SERVER_FAILED,
    SPATIALMANAGER_OPEN_SESSION_FAILED,
    AUTH_PARA_INVALID,
    ENCODE_DATA_ERROR,
    SPATIALMANAGER_OK = 0
};
} // namespace Msdp
} // namespace OHOS

#endif // SPATIAL_AWARENESS_MGR_ERRORS_H